/*
 * 版权所有 (c) 2022-2099 TBIT。保留所有权利。
 */

package com.tbit.common.constant;

/**
 * @author MyWin E-mail:335918956@qq.com
 * @version 1.0
 * @createTime 2019-12-13 13:37
 */
public class OrderLogConstant {
    // 网络
    public static Integer CHANNEL_TYPE_GPRS = 0;
    // 蓝牙
    public static Integer CHANNEL_TYPE_BLE = 1;

    // 指令来源
    // 用户 app
    public static Integer ORDER_SOURCE_APP_ANDROID = 1;
    public static Integer ORDER_SOURCE_APP_IOS = 2;
    public static Integer ORDER_SOURCE_APP_WX = 3;
    // 运维 app
    public static Integer ORDER_SOURCE_OPS_APP_ANDROID = 4;
    public static Integer ORDER_SOURCE_OPS_APP_IOS = 5;
    public static Integer ORDER_SOURCE_OPS_APP_WX = 6;
    // 网页
    public static Integer ORDER_SOURCE_WEB_MANAGER = 7;

    // 指令结果
    public static Integer ORDER_RSP_RET_SUCC = 1;
    public static Integer ORDER_RSP_RET_FAIL = 0;

    // 指令业务类型
    // 未知业务类型
    public static Integer BUSINESS_TYPE_UNKOWN = 0;

    public static boolean fromClient(Integer orderSource) {
        return orderSource != null && (orderSource.equals(ORDER_SOURCE_APP_ANDROID) || orderSource.equals(ORDER_SOURCE_APP_IOS) || orderSource.equals(ORDER_SOURCE_APP_WX));
    }

    public static boolean fromMain(Integer orderSource) {
        return orderSource != null && (orderSource.equals(ORDER_SOURCE_OPS_APP_ANDROID) || orderSource.equals(ORDER_SOURCE_OPS_APP_IOS) || orderSource.equals(ORDER_SOURCE_OPS_APP_WX));
    }

    public static boolean fromWeb(Integer orderSource) {
        return orderSource != null && orderSource.equals(ORDER_SOURCE_WEB_MANAGER);
    }
}
